#include <bits/stdc++.h>
using namespace std;

class A {
    public:
    A(int m):_m(m) {
        cout << this << " construct : " << _m << endl;
    }
    A( A& cp) {
        cout << this << " copy construct : " << _m << endl;
    }
    A(const A&& cp) {
        cout << this << " move construct : " << _m << endl;
    }
    A& operator=(A&& cp) {
        cout << this << " move assigned construct : " << _m << endl;
        return *this; 
    } 
    ~A() {
        cout << this << " deconstruct : " << _m << endl;
    }
    // private:
        int _m = 0;
};

A& getA() {
    // return A(100);
    A a(100);
    return a;
}
A& check(A&& a) {
    return a;
}

int main(){
    A& a = getA();
    // A b;
    // A a = move(A());
    // A a = A(101); 
    // check(a);
    // a = A();
    // A a(A());
    // A a(move(A()));
    cout << &a << endl;
    cout << a._m  << endl;
    cout << "please enter ...";
    cin.get();
    a.~A();
    // A b = a;
}